package file;

import java.io.*;
import java.io.FileOutputStream;

/**
 * InputStreamRead
 */

public class InputStreamRead {
    public static void main(String[] agrs) {
        File file=new File("e:\\cn.txt");

        try {
            OutputStreamWriter osw=new OutputStreamWriter(new FileOutputStream(file),"utf-8");
            String s="昆明华信智原";
            osw.write(s);
            osw.close();
            InputStreamReader  isr=new InputStreamReader(new FileInputStream(file),"utf-8");
            int c=isr.read();
            while (c!=-1) {
                System.out.print((char)c);
                c=isr.read();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
    }


